import React, { Component } from 'react'

const detailData = [
    { id: 1, title: "消息1", message: "啊吧啊" },
    { id: 2, title: "消息2", message: "啊吧啊吧" },
    { id: 3, title: "消息3", message: "啊吧啊吧啊" },
]
export default class Detail extends Component {
    render() {
        console.log(this.props.match.params)
        const { id } = this.props.match.params
        const findResult = detailData.find(item => {return item.id == id})
        console.log(findResult)
        return (
            <ul>
                <li>ID： {findResult.id}</li>
                <li>TITLE： {findResult.title}</li>
                <li>CONTENT:  {findResult.message}</li>
            </ul>
        )
    }
}
